/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.Controller;

import com.DAO.ConfigFTPDAO;
import com.thoughtworks.xstream.XStream;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 *
 * @author Fellipe
 */
@WebService(serviceName = "ConfigFTP")
public class ConfigFTP {
    
    private ConfigFTPDAO ftp = new ConfigFTPDAO();
    private XStream xstream = new XStream();
    
    @WebMethod(operationName = "readConfigFTP")
    public String read() {
        return toXMLFTP(ftp.read());
    }
    
    @WebMethod(operationName = "readUmConfigFTP")
    public String readUm(@WebParam(name = "chave") int chave) {
        return toXMLFTP(ftp.readUm(chave));
    }
    
    private String toXMLFTP(com.Model.ConfigFTP ftp) {
        
        return xstream.toXML(ftp);
        
    }
    
}
